//
//  ChatBaseMsg.h
//  SportSocial
//
//  Created by yull on 15/1/3.
//  Copyright (c) 2015年 yull. All rights reserved.
//

#import "Common.pb.h"

typedef NS_ENUM(NSInteger, ChatMsgRoleType)
{
    ChatMsgRoleTypeSend,
    ChatMsgRoleTypeReceive,
};

typedef NS_ENUM(NSInteger, ChatMsgType)
{
    ChatMsgTypeText = 0,
    ChatMsgTypeAudio = 1,
    ChatMsgTypePic = 2,
};

typedef NS_ENUM(NSInteger, ChatMsgSubType)
{
    ChatMsgSubTypeText,
    ChatMsgSubTypeAudio,
    ChatMsgSubTypePic,
    ChatMsgSubTypeRichText,
};

typedef NS_ENUM(NSInteger, ChatMsgSendStatus)
{
    ChatMsgSendStatusSending,
    ChatMsgSendStatusSuccess,
    ChatMsgSendStatusFail,
};

typedef NS_ENUM(NSInteger, ChatMsgAudioStatus)
{
    ChatMsgAudioStatusNone,
    ChatMsgAudioStatusLoading,
    ChatMsgAudioStatusPlaying,
};


@interface ChatBaseMsg : NSObject

@property (nonatomic, assign) UInt64 dbId;

@property (nonatomic, assign) UInt64 msgNum;

@property (nonatomic, assign) UInt64 sendId;

@property (nonatomic, copy) NSString *senderName;

@property (nonatomic, copy) NSString *content;

@property (nonatomic, copy) NSString *decodeContent;

@property (nonatomic, assign) UInt64 createTime;

@property (nonatomic, assign) ChatMsgType msgType;

@property (nonatomic, assign) ChatMsgSubType msgSubType;

@property (nonatomic, assign) ChatMsgRoleType roleType;

@property (nonatomic, copy) NSString* url;

@property (nonatomic, copy) NSString* bigImageUrl;

@property (nonatomic, assign) NSInteger msgLength;

@property (nonatomic, assign) BOOL isRead;

@property (nonatomic, assign) BOOL isAck;

@property (nonatomic, assign) ChatMsgSendStatus sendStatus;

@property (nonatomic, copy) NSString *retainField;

@property (nonatomic, assign) CGFloat picUploadPercent;

@property (nonatomic, copy) NSString *localPath;

@property (nonatomic, copy) NSString *icon;

#pragma mark - 临时字段
@property (nonatomic, assign) ChatMsgAudioStatus audioStatus;

@property (nonatomic, assign) NSInteger audioRestTime;

@property (nonatomic, strong) NSTimer *playTimer;

@property (nonatomic, strong) NSData *extendData;

@end
